using System;

namespace Rarous.NForms {
  /// <summary>
  /// Třída reprezentující skryté formulářové pole.
  /// </summary>
  public class HiddenItem : FormItem {
    /// <summary>
    /// Konstruktor.
    /// </summary>
    /// <param name="parent"></param>
    /// <param name="name"></param>
    public HiddenItem(Form parent, string name)
      : this(parent, name, null) {
    }

    /// <summary>
    /// Konstruktor.
    /// </summary>
    /// <param name="parent"></param>
    /// <param name="name"></param>
    /// <param name="attributes"></param>
    public HiddenItem(Form parent, string name, object attributes) {
      ConstructorContract(parent, name);

      Control = new HtmlElement(InputTag, new { Name = name, Type = InputType.Hidden }, HtmlElement.SelfClosing);

      Register(parent, name);
      SetAttributes(attributes);
    }
  }
}
